From 4f7a49d8d0836ab8183893f79ac5fb7731cac32c Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Mon, 6 Jun 2005 09:28:15 +0000 Subject: [PATCH] bitkeeper revision 1.1681 (42a4172fYhXBx6d4aXa2ofB5qVB2Ww) xc_gnttab.c, xc_evtchn.c: Cleanup error message printing and error exit code path. xc_vmx_build.c, xc_private.c, xc_plan9_build.c, xc_linux_build.c: Cleanup error message printing. Signed-off-by: Nguyen Anh Quynh Signed-off-by: Christian Limpach --- tools/libxc/xc_evtchn.c | 13 +++++++------ tools/libxc/xc_gnttab.c | 14 ++++++-------- tools/libxc/xc_linux_build.c | 4 ++-- tools/libxc/xc_plan9_build.c | 2 +- tools/libxc/xc_private.c | 4 ++-- tools/libxc/xc_vmx_build.c | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c index 8ee2fd11ee..1c0294d83b 100644 --- a/tools/libxc/xc_evtchn.c +++ b/tools/libxc/xc_evtchn.c @@ -19,15 +19,16 @@ static int do_evtchn_op(int xc_handle, evtchn_op_t *op) if ( mlock(op, sizeof(*op)) != 0 ) { - PERROR("Could not lock memory for Xen hypercall"); - goto out1; + PERROR("do_evtchn_op: op mlock failed"); + goto out; } - if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 ) - goto out2; + if ((ret = do_xen_hypercall(xc_handle, &hypercall)) < 0) + ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret); - out2: (void)munlock(op, sizeof(*op)); - out1: return ret; + (void)munlock(op, sizeof(*op)); + out: + return ret; } diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c index 2601c30f60..ad23e68013 100644 --- a/tools/libxc/xc_gnttab.c +++ b/tools/libxc/xc_gnttab.c @@ -26,18 +26,16 @@ do_gnttab_op( int xc_handle, if ( mlock(op, sizeof(*op)) != 0 ) { - PERROR("Could not lock memory for Xen hypercall"); - goto out1; + PERROR("do_gnttab_op: op mlock failed"); + goto out; } if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 ) - { - printf("do_gnttab_op: hypercall returned error %d\n", ret); - goto out2; - } + ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret); - out2: (void)munlock(op, sizeof(*op)); - out1: return ret; + (void)munlock(op, sizeof(*op)); + out: + return ret; } diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index f90f3f3aef..83e7ca8d4c 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -193,7 +193,7 @@ static int setup_guest(int xc_handle, } (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array, - &dsi); + &dsi); /* Load the initial ramdisk image. */ if ( initrd_len != 0 ) @@ -466,7 +466,7 @@ int xc_linux_build(int xc_handle, if ( mlock(&st_ctxt, sizeof(st_ctxt) ) ) { - PERROR("Unable to mlock ctxt"); + PERROR("xc_linux_build: ctxt mlock failed"); return 1; } diff --git a/tools/libxc/xc_plan9_build.c b/tools/libxc/xc_plan9_build.c index 08ac06d08a..544485aa42 100644 --- a/tools/libxc/xc_plan9_build.c +++ b/tools/libxc/xc_plan9_build.c @@ -434,7 +434,7 @@ xc_plan9_build(int xc_handle, DPRINTF(("xc_get_tot_pages returns %ld pages\n", tot_pages)); if (mlock(&st_ctxt, sizeof (st_ctxt))) { - PERROR("Unable to mlock ctxt"); + PERROR("xc_plan9_build: ctxt mlock failed"); return 1; } diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 7b8ec3d113..87e5ecd1f3 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -122,7 +122,7 @@ static int flush_mmu_updates(int xc_handle, mmu_t *mmu) if ( mlock(mmu->updates, sizeof(mmu->updates)) != 0 ) { - PERROR("Could not lock pagetable update array"); + PERROR("flush_mmu_updates: mmu updates mlock failed"); err = 1; goto out; } @@ -226,7 +226,7 @@ int xc_get_pfn_list(int xc_handle, if ( mlock(pfn_buf, max_pfns * sizeof(unsigned long)) != 0 ) { - PERROR("Could not lock pfn list buffer"); + PERROR("xc_get_pfn_list: pfn_buf mlock failed"); return -1; } diff --git a/tools/libxc/xc_vmx_build.c b/tools/libxc/xc_vmx_build.c index b5e948c622..c30fd4c49b 100644 --- a/tools/libxc/xc_vmx_build.c +++ b/tools/libxc/xc_vmx_build.c @@ -529,7 +529,7 @@ int xc_vmx_build(int xc_handle, if ( mlock(&st_ctxt, sizeof(st_ctxt) ) ) { - PERROR("Unable to mlock ctxt"); + PERROR("xc_vmx_build: ctxt mlock failed"); return 1; } -- 2.30.2